<?php declare(strict_types=1);
/**
 * @author      xianganyall <xianganyall@gmail.com>
 * @copyright   2023-2025 owner
 **/

namespace Srv\Apps\Apis\Common\DefCtl;

final class DefChannelCtl extends DefAbstract
{
    private const TABLE_NAME                = 'idx_channel';
    private const FIELD_ID                  = 'dcht_id';
    private const FIELD_KEY                 = 'dcht_key';
    private const FIELD_NAME                = 'dcht_name';
    private const FIELD_TYPE                = 'dcht_type';
    private const FIELD_MARKET              = 'dcht_market';
    private const FIELD_MARKET_TO           = 'dcht_market_to';
    private const FIELD_MARKET_TO_FORCE     = 'dcht_market_to_force';
    private const FIELD_MARKET_VERSION      = 'dcht_market_version';
    public const EXT_DEVICE_TYPE            = 'deviceType';
    public const EXT_MARKET                 = 'market';
    public const EXT_MARKET_TO              = 'marketTo';
    public const EXT_MARKET_TO_FORCE        = 'marketToForce';
    public const EXT_MARKET_VERSION         = 'marketVersion';
    public const EXT_NAME                   = 'name';

    public const KEY_APPSTORE               = 'appstore';
    public const KEY_OFFICIAL               = 'official';
    public const KEY_GGPLAY                 = 'ggplay';
    public const KEY_HUAWEI                 = 'huawei';
    public const KEY_XIAOMI                 = 'xiaomi';
    public const KEY_OPPO                   = 'oppo';
    public const KEY_VIVO                   = 'vivo';
    public const KEY_TENCENT                = 'tencent';
    public const KEY_OFFICIAL_WEB           = 'official_web';
    public const KEY_JULIANG                = 'juliang';

    /**
     * @return static
     * tag
     */
    public static function tag():self
    {
        $fieldExtList       = [
            self::EXT_DEVICE_TYPE       => self::FIELD_TYPE,
            self::EXT_MARKET            => self::FIELD_MARKET,
            self::EXT_MARKET_TO         => self::FIELD_MARKET_TO,
            self::EXT_MARKET_TO_FORCE   => self::FIELD_MARKET_TO_FORCE,
            self::EXT_MARKET_VERSION    => self::FIELD_MARKET_VERSION,
            self::EXT_NAME              => self::FIELD_NAME,
        ];
        return parent::tag()->config(self::TABLE_NAME, self::FIELD_ID, self::FIELD_KEY, $fieldExtList);
    }
}